package com.biz;

import com.actionForm.ProductActionForm;
import com.dao.CheckOUtProducts;
import com.dao.SaveProduct;
import entities.Product;
import entities.Users;
import com.Interfacese.*;

public class ProductMessageHandle implements SaveProductInterface,BuyProductInterface{
	public int buyProduct(Users u,Product p, int num)throws Exception{
		CheckOUtProducts cop = new CheckOUtProducts();
		int temp =  cop.buyProduct(u, p, num);
		return temp;
	}

	public void saveProduct(ProductActionForm form) {
		SaveProduct sp = new SaveProduct();
		Product p = new ActionFormToBean().productActionFormToProductBean(form);
		sp.saveProduct(p);

	}
	
}
